﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

namespace $safeprojectname$.Web
{
    /// <summary>
    ///     This model serves as the holder of the current user information.
    ///     Properties could (should) be filled in some of the AOP filters.
    ///     The best choice would be the AccessRights evaluating one.
    ///     MasterPage then can use these values for rendering.
    ///     (suggestion: for internet app it could be extended with the transfer to login for example)
    /// </summary>
    public interface ICurrentUserModel : ICoreModel
    {
        /// <summary>
        ///     This property should contain the current (athenticated) user
        ///     Description (e.g. first and second name)
        ///     If not set, then returns UserLogin ?? string.Empty
        /// </summary>
        string UserName { get; set; }

        /// <summary>
        ///     This property should contain the current (athenticated) user unique identification 
        ///     (e.g. login). This value is used only for rendering on UI.
        /// </summary>
        string UserLogin { get; set; }

        /// <summary>
        ///     If application provides some middle tier between user RoleProvider.Roles 
        ///     and application business roles - provide the CurrentStateDescription and CurrentStateEntity.
        ///     Example of the CurrentStateDescription: 'Role', 'On behalf of' etc.
        /// </summary>
        string CurrentStateDescription { get; set; }

        /// <summary>
        ///     If application provides some middle tier between user RoleProvider.Roles 
        ///     and application business roles - provide the CurrentStateDescription and CurrentStateEntity.
        ///     Example of the CurrentState: 'Administrator', 'Viewer', 'as JOHN' etc.
        ///     CurrentStateEntity must be IPersistent to provide ToDisplay() and the ID properties 
        ///     which could be used for runtime changes
        /// </summary>
        object CurrentStateEntity { get; set; }

        /// <summary>
        ///     If application supports the middle tier for changing the user business role
        ///     (the one provided in the 'CurrentState' property)
        ///     provide this URL.
        ///     On MasterPage this could be used for generating the linkt to that action
        /// </summary>
        string ChangeStateUrl { get; set; }

        /// <summary>
        ///     when forms authentication is used, allowes to quickly Logout...
        /// </summary>
        string LogoutUrl { get; set; }
    }
}